<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"  prefix="fn"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>后台数据信息</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="shortcut icon" type="image/x-icon" href="https://wwl.ycws.cc/image/backgroundimage/e.ico">
	<!--<link rel="stylesheet" type="text/css" href="styles.css">-->
	<script src="js/jquery-1.11.3.min.js"></script>
	<script type="text/javascript">
	function disable(id){
		var id2=id;
		var num  = document.getElementById("option").value;
		var name  = document.getElementById("shooting").value;
		debugger;
		var paer={id:id2,num:num,name:name};
		$.ajax({
			url:"${path}/bassm/Visitor/addUserInformationFist",
			data:paer,
			type:"post",
			async:false,
			success:function(date){
				if(date.msg==1){		
					var xq=date.detailed;
					window.location.href = "${path}/bassm/Visitor/visitorsuser3?Celladdress="+xq;
					alert("成功");
				}else{
					alert("错误")
				}
			},
			error:function(){
				alert("异常错误，请联系供应商");
			}
		});
	}
	</script>
	
	<script type="text/javascript">
	function disable(id){
		var id2=id;
		var num  = document.getElementById("option").value;
		var name  = document.getElementById("shooting").value;
		var paer={id:id2,num:num,name:name};
		$.ajax({
			url:"${path}/bassm/Visitor/addUserInformationFist",
			data:paer,
			type:"post",
			async:false,
			success:function(date){
				if(date.msg==1){		
					var xq=date.detailed;
					window.location.href = "${path}/bassm/Visitor/visitorsuser3?Celladdress="+xq;
					alert("成功");
				}else{
					alert("错误")
				}
			},
			error:function(){
				alert("异常错误，请联系供应商");
			}
		});
	}
	</script>
	<script type="text/javascript">
	function finname(yid){
		var sfzid2=yid;
		var paer={id:sfzid2};
		debugger;
		$.ajax({
			url:"${path}/bassm/Visitor/DeleUserInformationFist",
			data:paer,
			type:"get",
			async:false,
			success:function(date){
				if(date.msg==1){		
					var xq=date.detailed;
					window.location.href = "${path}/bassm/Visitor/visitorsuser3?Celladdress="+xq;
					alert("成功");
				}else{
					alert("错误");
				}
			},
			error:function(){
				alert("异常错误，请联系供应商");
			}
		});
	}
	</script>
	<script type="text/javascript">
	$(function(){
		$("#exect").click(function(){
				window.location.href = "${path}/bassm/index.jsp";		
		});
		$("#adduserto").click(function(){
			window.location.href = "${path}/bassm/add.jsp";		
		});
		$("#addusertotwo").click(function(){
			window.location.href = "${path}/bassm/user/showMyUserImg";		
		});
	});
	</script>
	<script type="text/javascript">
	$(function(){
		$("#selectdan").click(function(){
			debugger;
				var yaddressall=$.trim($("#yaddressall").text())
				var phonename=$("#phonename").val();
				var nameonefin=$("#nameonefin").val();
				var phonename1 = phonename.replace(/(^\s*)|(\s*$)/g, '');
				var nameonefin1 = nameonefin.replace(/(^\s*)|(\s*$)/g, '');
				var paer={phonename:phonename1,nameonefin:nameonefin1};
				if(!phonename1==''||!nameonefin1==''){
					window.location.href = "${path}/bassm/Visitor/selectFinPhoneorUserName?phonename="+phonename1+"&nameonefin="+nameonefin1+"&yaddressall="+yaddressall;
				}else{
					alert("搜索条件必须填写一项");
				}
				
	});
	});
	</script>
	
	<script type="text/javascript">
	$(function(){
		$("#returnuserlist").click(function(){
				var yaddressall=$.trim($("#yaddressall").text())
				window.location.href ="${path}/bassm/Visitor/visitorsuser3?Celladdress="+yaddressall;
	});
	});
	</script>
<script type="text/javascript">
	function Upfinname(id,yaddress){
		var yid=id;
		var address =yaddress;
		window.location.href = "${path}/bassm/Visitor/selectFinPhoneorUserNameLou?yid="+yid+"&yaddress="+address;
	}
</script>
  </head>
  <body >
    	<form action="<%=path%>/pc_uploadfile/selectYnameOrYphone" method="post">
  		<table style="padding-left:46%">
  			<tr height="50">
  			<td align="right" colspan="8">
  			手机号:<input type="text" id="phonename" name="phonename" style="width: 150px;  height: 40px;">
  			姓名：<input type="text" id="nameonefin" name="nameonefin" style="width: 150px;  height: 40px;">
  			<td align="right" colspan="8">
  			<input type="button" id="selectdan" value="搜索" style="height: 40px; width:120px; color: white; font-size:16px; background-color:47A7FA;">
  			</td>
  			<td align="right" colspan="8">
  			<input type="button" id="returnuserlist" value="返回" style="height: 40px; width:120px; color: white; font-size:16px; background-color:C53320;">
  			</td>
    		<td align="right" width="100px;">
    			<input type="button"  id="exect" value="退出登录" style="width: 120px; height: 40px;font-size:16px; background-color:C53320;color: white;">
    		</td>
    	</tr>
  		</table>
  	</form>
	<div style="text-align: center;">
  	</div>
    <table border="1" cellpadding="0" cellspacing="0" align="center" >
    	<tr align="center" height="50" style="background-color:2082D5; color:white;">
    		
    		<td width="100">头像</td>
    		<td width="100">姓名</td>
    		<td width="50">性别</td>
    		<td width="150">手机</td>
    		<td width="150">小区地址</td>
    		<td width="100">单元楼</td>
    		<td width="100">外门</td>
    		<td width="100">类型</td>
    		<td width="100">有效时间</td>
    		<td width="100">用户状态</td>
    		<td width="150">操作</td>
    	</tr>
    	<c:forEach var="v" items="${products}">
	    	<tr align="center" style="background-color:#fafafa;">
	    			
	    			<td><img alt="" src="${v.yimageurl}" width="100" height="120"></td>
	    			<td>${v.yname}</td>
	    			<td>${v.ysex}</td>
	    			<td>${v.yphone}</td>
	    			<td id="yaddressall">${v.yaddress}</td>	    			
	    			<td> 			
	    			<c:if test="${(v.yunitdoor =='0') }">
					全部
					</c:if>
	    			
	    			<c:if test="${(v.yunitdoor != '0') }">
					${v.yunitdoor}
					</c:if>
					</td>
					<td>
					<c:if test="${empty v.gun}">
					<select id ="shooting" name="shooting">
					<c:forEach var="s" items="${shooting}">
					<option value=${s.name}>${s.name}</option>
					</c:forEach>
					</c:if>
					<c:if test="${not empty v.gun}">
					${v.gun}
					</c:if>
					</td>
	    			<td>
	    			<c:if test="${fn:contains(v.visitorstype,'1') }">
	    			30天
	    			</c:if>
	    			<c:if test="${fn:contains(v.visitorstype,'2') }">
	    			1天
	    			</c:if>
	    			<c:if test="${empty v.visitorstype}">
	    			<select id ="option" name="option">
	    			<option value="1">30天</option>
	    			<option value="2">1天</option>
	    			</select>
	    			</c:if>
	    			</td>    			
	    			<td>${v.state}</td>
	    			<td>
	    				<c:if test="${fn:contains(v.yindate,'1') }">
        					<img alt="" src="img/15.jpg">
        				</c:if>
        				<c:if test="${fn:contains(v.yindate,'0') }">
        					<img alt="" src="img/14.jpg">
        				</c:if>
	    			</td>
	    			<td>
	    				<input type="button" onclick="disable(${v.yid})" id="addbmd" value="允许" style="width: 40px; height: 33px; background-color: #2082D5;color: white;">
	    				<input type="button" onclick="Upfinname(${v.yid},'${v.yaddress}')" id="Upfinname" value="修改" style="width: 40px; height: 33px; background-color:#FE6262;color: white;">	
	    				<input type="button" onclick="finname(${v.yid})"id="finname" value="禁止" style="width: 40px; height: 33px; background-color:#FE6262;color: white;">
	    			</td>
	    	</tr>
	    	
    	</c:forEach>
    </table>
  <div align="center"  style="height:50px">
        <font size="3">共 ${page.totalPageCount} 页</font> <font size="3">第  
            ${page.pageNow} 页
            </font>
            <c:forEach var="y" items="${products}">
             <a href="Visitor/selectFinPhoneorUserName?pageNow=1&yaddressall=${y.yaddress}&phonename=${phonename}&nameonefin=${nameonefin}">
             </c:forEach>首页</a>  
        <c:choose>  
            <c:when test="${page.pageNow - 1 > 0}"> 
            <c:forEach var="y" items="${products}"> 
                <a href="Visitor/selectFinPhoneorUserName?pageNow=${page.pageNow - 1}&yaddressall=${y.yaddress}&phonename=${phonename}&nameonefin=${nameonefin}"> 
                </c:forEach>上一页</a>  
            </c:when>  
            <c:when test="${page.pageNow - 1 <= 0}"> 
            <c:forEach var="y" items="${products}"> 
                <a href="Visitor/selectFinPhoneorUserName?pageNow=1&yaddressall=${y.yaddress}&phonename=${phonename}&nameonefin=${nameonefin}"> 
                </c:forEach>上一页</a>  
            </c:when>  
        </c:choose>  
        <c:choose>  
            <c:when test="${page.totalPageCount==0}"> 
            <c:forEach var="y" items="${products}"> 
                <a href="Visitor/selectFinPhoneorUserName?pageNow=${page.pageNow}&yaddressall=${y.yaddress}&phonename=${phonename}&nameonefin=${nameonefin}">
                 </c:forEach>下一页</a>  
            </c:when>  
            <c:when test="${page.pageNow + 1 < page.totalPageCount}">  
            <c:forEach var="y" items="${products}">
                <a href="Visitor/selectFinPhoneorUserName?pageNow=${page.pageNow + 1}&yaddressall=${y.yaddress}&phonename=${phonename}&nameonefin=${nameonefin}"> 
                </c:forEach>下一页</a>  
            </c:when>  
            <c:when test="${page.pageNow + 1 >= page.totalPageCount}">  
            <c:forEach var="y" items="${products}">
                <a href="Visitor/selectFinPhoneorUserName?pageNow=${page.totalPageCount}&yaddressall=${y.yaddress}&phonename=${phonename}&nameonefin=${nameonefin}"> 
                </c:forEach>下一页</a>  
            </c:when>  
        </c:choose>  
        <c:choose>  
            <c:when test="${page.totalPageCount==0}">  
            <c:forEach var="y" items="${products}">
                <a href="Visitor/selectFinPhoneorUserName?pageNow=${page.pageNow}&yaddressall=${y.yaddress}&phonename=${phonename}&nameonefin=${nameonefin}"> 
                </c:forEach>尾页</a>  
            </c:when>  
            <c:otherwise> 
            <c:forEach var="y" items="${products}"> 
                <a href="Visitor/selectFinPhoneorUserName?pageNow=${page.totalPageCount}&yaddressall=${y.yaddress}&phonename=${phonename}&nameonefin=${nameonefin}"> 
                </c:forEach>尾页</a>  
            </c:otherwise>  
        </c:choose>

    </div>
  </body>
</html>
